#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int digit, i, letter, N, other, blank;
	char ch;
	digit = letter = other = blank = 0;
	scanf("%d", &N);
	getchar();
	for (i = 1; i <= N; i++)
	{
		ch = getchar();
		if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
		{
			letter++;
		}
		else if (ch >= '0' && ch <= '9')
		{
			digit++;
		}
		else if (ch == ' ' || ch == '\n')
		{
			blank++;
		}
		else
		{
			other++;
		}
	}
	printf("letter = %d, blank = %d, digit = %d, other = %d\n", letter, blank, digit, other);

	return 0;
}